<?php require_once 'head.html';?>
        <div class="span9">
		  <div class="row-fluid">
			<div class="page-header">
				<h1>文章列表 <small>Article List</small> </h1>
			</div>
			<?php if(count($article)){?>
			<table class="table table-striped table-bordered table-condensed">
				<thead>
					<tr>
						<th>编号</th>
						<th>标题</th>
						<th>摘要</th>
						<th>日期</th>
						<th>分类</th>
						<th>作者</th>
						<th>状态</th>
						<th>操作</th>
					</tr>
				</thead>
				<tbody>
				<?php  $i=1;foreach($article as $art){?>
				<tr class="list-users">
					<td><?php echo $i;?></td>
					<td><a href="?c=opt&ip=edit&id=<?php echo $art['id'];?>"><?php echo $art['title'];?></a></td>
					<td><?php echo iconv_substr(strip_tags($art['content']),1,40,"UTF-8");?>...</td>
					<td><?php echo date("Y-m-d",$art['times']);?></td>
					<td><?php echo $art['ify_name'];?></td>
					<td><?php echo $art['athor'];?></td>
					<?php if($art['type'] !== 'CheckPage'){ if($art['mend']){?><td><span class="label label-success">已推荐</span></td><?php }else{?><td><span class="label label-warning">未推荐</span></td><?php } } else {?><td><span class="label label-danger">待审核</span></td><?php }?>
					<td>
						<div class="btn-group">
							<a class="btn btn-mini dropdown-toggle" data-toggle="dropdown">操作 <span class="caret"></span></a>
							<ul class="dropdown-menu">
								<li><a href="?c=opt&ip=edit&id=<?php echo $art['id'];?>"><i class="icon-pencil"></i> 修改</a></li>
								<li><a onclick='if (confirm("确定删除？") == true){location.href="?c=opt&ip=del&id=<?php echo $art['id'];?>";}'><i class="icon-trash"></i> 删除</a></li>
								<?php if($art['type'] !== 'CheckPage'){ if($art['mend']){?> <li><a href="?c=opt&ip=mend&id=<?php echo $art['id'];?>&v=0"><i class="icon-refresh"></i> 取消</a></li><?php }else{?> <li><a href="?c=opt&ip=mend&id=<?php echo $art['id'];?>&v=1"><i class="icon-refresh"></i> 推荐</a></li> <?php } }else {?> <li><a href="?c=opt&ip=check&id=<?php echo $art['id'];?>"><i class="icon-refresh"></i> 审核</a></li><?php }?>
							</ul>
						</div>
					</td>
				</tr>
				<?php $i++;} ?>

				</tbody>
			</table>
			<div class="pagination">
				<ul>
					<li><a href="?c=art&go=<?php echo $type;?>&p=<?php if($n == 1){echo 1;}else{echo $n-1;}?>">上页</a></li>
					
					<?php 
								
									pagebar($pageCount, $n, 5, $type);
									
									?>
					
				
					<li><a href="?c=art&go=<?php echo $type;?>&p=<?php if($n == $pageCount){echo $pageCount;}else{echo $n+1;}?>">下页</a></li>
					
					<li><select name="dh" style="height: 36px;" onchange="javascript:location.href=this.value;">  
                    <option>选择类型查看</option>
                    <option value="?c=art&go=article">文章栏目</option>
                    <option value="?c=art&go=music">音乐栏目</option>
                    <option value="?c=art&go=video">视频栏目</option>
                    <option value="?c=art&go=images">图片栏目</option>
                    <option value="?c=art&go=down">下载栏目</option>
                    <option value="?c=art&go=CheckPage">待审核文章</option>
                    </select></li>
                    
				</ul>
				
			</div>
			<?php }else{?>
			<p>没有文章哦，去写一个吧，或者<select name="dh" style="margin:0px; padding:0px;" onchange="javascript:location.href=this.value;">  
                    <option>选择类型查看</option>
                    <option value="?c=art&go=article">文章栏目</option>
                    <option value="?c=art&go=music">音乐栏目</option>
                    <option value="?c=art&go=video">视频栏目</option>
                    <option value="?c=art&go=images">图片栏目</option>
                    <option value="?c=art&go=down">下载栏目</option>
                    <option value="?c=art&go=CheckPage">待审核文章</option>
                    </select></p><hr>
			<?php }?>
			<a href="?c=add_page" class="btn btn-success">发表新文章</a>
		  </div>
        </div>
      </div>

      <hr>

     <?php require_once 'foot.html';?>

    </div>

   <script src="Delivery/js/jquery.js"></script>
	<script src="Delivery/js/bootstrap.min.js"></script>
	<script>
	$(document).ready(function() {
		$('.dropdown-menu li a').hover(
		function() {
			$(this).children('i').addClass('icon-white');
		},
		function() {
			$(this).children('i').removeClass('icon-white');
		});
		
		if($(window).width() > 760)
		{
			$('tr.list-users td div ul').addClass('pull-right');
		}
	});
	</script>
  </body>
</html>
